//
//  PopViewController.swift
//  viewcontroller_test
//
//  Created by 潘茹燕 on 16/3/15.
//  Copyright © 2016年 海南开工信息技术有限公司. All rights reserved.
//

import UIKit
import ZFDragableModalTransition

class PopViewController: UIViewController {
    
    var animator: ZFModalTransitionAnimator?

    @IBOutlet weak var buttonLongPressTest: UIButton!
    
    
    @IBAction func onButtonTouchUpOutside(sender: AnyObject) {
        
        NSLog("Touch Up Outside!")
        
    }
    @IBAction func onButtonTouchUpInside(sender: AnyObject) {
        
        NSLog("Touch Up Inside!")
        
    }
    
    
    @IBAction func onClickPopup(sender: AnyObject) {
        
        
        let viewController = storyboard?.instantiateViewControllerWithIdentifier("ModelViewController")
        
        viewController?.modalPresentationStyle = .OverFullScreen
        
        
        animator = ZFModalTransitionAnimator(modalViewController: viewController)
        animator?.bounces = true
        animator?.transitionDuration = 0.7
        animator?.behindViewAlpha = 1.0
        animator?.behindViewScale = 0.9
        animator?.dragable = true
        
        animator?.direction = .Bottom
        
        viewController?.transitioningDelegate = animator
        
        presentViewController(viewController!, animated: true, completion: nil)
        
        
        
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        
        
    }
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
